package com.huadao.cart_ccs.experiment.log;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.view.View;

import com.huadao.cart_ccs.R;
import com.huadao.cart_ccs.base.BaseFragment;
import com.huadao.cart_ccs.base.BasePresenter;
import com.huadao.cart_ccs.experiment.log.exception.ExceptionFrag;
import com.huadao.cart_ccs.experiment.log.paramsAnysis.ParamsAnysisFrag;

import butterknife.OnClick;

public class LogExceptionFrag extends BaseFragment {

    private FragmentManager fragmentManager;
    private ExceptionFrag exceptionFrag;
    private ParamsAnysisFrag paramsAnysisFrag;

    @Override
    public int getContentViewId() {
        return R.layout.frag_logexception;
    }

    @Override
    protected void initAllMembersView(Bundle savedInstanceState) {
        fragmentManager = getChildFragmentManager();
    }

    @Override
    protected BasePresenter getPresenter() {
        return null;
    }

//    @OnClick({R.id.btn_exception})
//    public void onViewClicked(View view) {
//        switch (view.getId()) {
//            case R.id.btn_exception:
//                if(exceptionFrag==null){
//                    exceptionFrag=new ExceptionFrag();
//                }
//                replaceFrag(exceptionFrag);
//                break;
//        }
//    }

    private void replaceFrag(Fragment fragment){
        FragmentTransaction fragmentTransaction=fragmentManager.beginTransaction();
        fragmentTransaction.replace(R.id.fl_log_exception,fragment).commitAllowingStateLoss();
    }
}
